package com.lzy.mall.member.service.impl;

import com.lzy.mall.member.entity.UmsMemberReceiveAddress;
import com.lzy.mall.member.dao.UmsMemberReceiveAddressDao;
import com.lzy.mall.member.service.UmsMemberReceiveAddressService;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * 会员收货地址(UmsMemberReceiveAddress)表服务实现类
 *
 * @author lzy
 * @since 2021-08-25 11:38:53
 */
@Service
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class UmsMemberReceiveAddressServiceImpl implements UmsMemberReceiveAddressService {
    private final UmsMemberReceiveAddressDao memberReceiveAddressDao;

    @Override
    public List<UmsMemberReceiveAddress> getAddress(Long memberId) {
        return memberReceiveAddressDao.createLambdaQuery()
                .andEq(UmsMemberReceiveAddress::getMemberId,memberId)
                .select();
    }

    @Override
    public UmsMemberReceiveAddress getById(Long id) {
        return memberReceiveAddressDao.single(id);
    }
}
